#pragma once
#ifndef _KINECT1FUNC_H
#define _KINECT1FUNC_H

#include <windows.h>
#include <NuiApi.h>
#include <opencv2/opencv.hpp>

typedef struct structBGR {
    BYTE blue;
    BYTE green;
    BYTE red;
} BGR;

class Kinect1Func {

public:
    Kinect1Func();
    int cameraCapture(int CapFreq, int CapTimes);
    int cameraShutDown();

private:
    BGR Depth2RGB(USHORT depthID);
    void getColorImage(HANDLE & colorStreamHandle, cv::Mat & colorImg);
    void getDepthImage(HANDLE & depthStreamHandle, cv::Mat & depthImg, cv::Mat & mask);
    void getSkeletonImage(cv::Mat & skeletonImg, cv::Mat & colorImg);
    void drawSkeleton(cv::Mat &img, cv::Point pointSet[], int which_one);

    bool tracked[NUI_SKELETON_COUNT] = { FALSE };
    cv::Point skeletonPoint[NUI_SKELETON_COUNT][NUI_SKELETON_POSITION_COUNT] = { cv::Point(0, 0) };
    cv::Point colorPoint[NUI_SKELETON_COUNT][NUI_SKELETON_POSITION_COUNT] = { cv::Point(0, 0) };
    std::ofstream mycout;
    bool bstopflag;

};

#endif